package com.tb.tbv1background.controller;

//import com.alibaba.dubbo.config.annotation.Reference;
//import com.github.pagehelper.PageInfo;
//import com.tb.v1.api.product.IProductService;
//import com.tb.v1.api.vo.ProductVO;
//import com.tb.v1.entity.TProduct;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author: tangBin
 * @Date: 2020/6/4 0004 18:47
 * @Description:
 */
@Controller
@RequestMapping("/product")
public class productController {

   /* @Reference
    private IProductService productService;

    @GetMapping("list")
    public String list(Model model){
        List<TProduct> list = productService.getAll();
        model.addAttribute("list",list);
        return "product/list";
    }

    @GetMapping("page/{pageIndex}/{pageSize}")
    public String page(Model model, @PathVariable("pageIndex") Integer pageIndex,
                       @PathVariable("pageSize")Integer pageSize){
        PageInfo<TProduct> list = productService.page(pageIndex,pageSize);
        model.addAttribute("list",list);
        return "product/list";
    }

    @RequestMapping("add")
    public String add(ProductVO productVo){
        int id = productService.add(productVo);
        return "redirect:/product/page/1/1";
    }*/

    @RequestMapping("testDocker")
    @ResponseBody
    public String testDocker() {
        return "hello docker mmmmmmm999999";
    }
}
